package io.github.wslxm.springbootplus2.core.base.model;


import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Pattern;
import lombok.Data;


/**
 * 通用查询字段
 * @author wangsong
 * @mail 1720696548@qq.com
 * @date 2021/8/25 0025 11:53
 * @version 1.0.1
 */
@Data
public class BaseQuery extends Convert {


    @Schema(description = "页数(小于等于0查询所有,不传默认1)")
    private Long current = 1L;

    @Schema(description = "每页数量 (不传默认10)")
    private Long size = 10L;

    @Schema(description = "排序字段")
    private String sort = "create_time";

    @Schema(description = "排序规则 (asc | desc)")
    @Pattern(regexp = "^(asc|desc)$", message = "Sort direction must be 'asc' or 'desc'")
    private String order = "desc";

}
